#!/bin/bash
set -e

function info() {
echo Usage: `basename $0` 'in.vcf [in.vcf ...]'
exit 65
}

while getopts ":p:h" opts
do
case $opts in
p) out_prefix=$OPTARG;;
\?) info;;
esac
done
shift $(($OPTIND - 1))

test $# -lt 1 && info


. /mnt/ilustre/app/medical/tools/.var

for file in $@; do
echo;echo format $file
format_all_0508.sh $file $file.txt
format_all_1030.sh $file $file.2.txt $file.2.html.txt
files="$files $file.txt"
files2="$files2 $file.2.txt "
files2a="$files2a $file.2.html.txt "
done

echo $files
echo $files2
echo $files2a

echo txt2xls
txt2xls_0222.pl $out_prefix.summary.txt gene_summ.txt $files $out_prefix.xls
txt2xls_0222.pl $out_prefix.summary.txt gene_summ.txt $files2 $out_prefix.2.xls

echo format jxl
format_jxl.sh $out_prefix.xls $out_prefix.jxl.xls
format_jxl.sh $out_prefix.2.xls $out_prefix.2.jxl.xls
	


echo txt2html
snp_html_0223.sh $out_prefix.summary.txt gene_summ.txt $files
snp_html_0223.sh -p1.2 $out_prefix.summary.txt gene_summ.txt $files2a

. $cmd_done